import requests
from lxml import etree

url = 'https://movie.douban.com/subject/3541415/comments?status=P'
headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/86.0.4240.183 Safari/537.36'
}
r = requests.get(url=url, headers=headers)

# print(text)
html = etree.HTML(r.text)
print(html)
comment_list = html.xpath('//span[@class="short"]/text()')
print("提取到的个数：", len(comment_list))
for temp in comment_list:
    print(temp)
    print()
